package 牛客_面试必刷.Month07.day14;

public class 跳台阶 {
    public int jumpFloor(int target) {
        int i = 1;
        int j = 2;
        int res = 0;
        if(target == 1){
            return i;
        }else if(target == 2){
            return j;
        }
        for (int k = 3; k <= target; k++) {
            res = i + j;
            i = j;
            j = res;

        }
        return res;
    }
}
